home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / April 96 / Re TRUE & FALSE < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.7 KB  |  [TEXT/ttxt]

  1. Subject:     Re: TRUE & FALSE
  2. Sent:        4/22/96 3:50 PM
  3. Received:    4/22/96 5:11 PM
  4. From:        Jim Lloyd, jim@melongem.com
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. At 2:45 PM 4/22/96, Gary Ashcraft wrote:
  9. >ODF Team,
  10. >
  11. >For booleans, ODF defines TRUE and FALSE.  OpenDoc uses kODTrue and
  12. >kODFalse.  The CW IDE indicates that true and false are boolean keywords.
  13. >
  14. >I see in FWStdDef.h that TRUE = 1 and FALSE = 1; the OpenDoc class
  15. >reference says that "the size of a boolean type is platform-dependant";
  16. >then says that kODTrue = True and kODFalse = False.
  17. >
  18. >Could you explain the reasoning for defining new booleans instead of just
  19. >using the ones provided by OpenDoc?
  20.  
  21. For ODF R1, we came very close to just using the definitions provided by
  22. the proposed ANSI/ISO standard (i.e. bool, true, false).  We had even
  23. changed FW_Boolean to bool in most of the sources.  However, in the end we
  24. decided we had to have a definition that we had control over. As you
  25. mentioned, the OpenDoc class reference says the size of the boolean type is
  26. platform-dependent.  We need to have a well-understood definition because
  27. we do things like this:
  28.  
  29. FW_Boolean flag;
  30. FW_CReadableStream stream;
  31. stream >> flag;
  32.  
  33. The number of bytes read from the stream is dependent on the definition of
  34. FW_Boolean. Because of this, we need a definition that is unambiguous now
  35. and in the future.
  36.  
  37. Note that you are pretty much free to use whichever symbolic constants you
  38. want. The existing definitions of true, false, kODTrue, kODFalse, TRUE, and
  39. FALSE are are consistent when used in logical expressions.  The only
  40. problems that occur have to do with assumptions made concerning size of
  41. arguments.
  42.  
  43. Jim Lloyd
  44. ODF Team
  45.  
  46.